home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / applications / wp / ttx2_sasc.lha / Rexx / TTX_SASC / CPR.ttx < prev    next >
Encoding:
Text File  |  1994-10-24  |  1.1 KB  |  42 lines

  1.  
  2. /** $VER: CPR.ttx 2.1 (17.8.93)
  3.  **
  4.  ** Starts CPR on an executable, that is assumed to exist in the same
  5.  ** directory as the current file, and whose name is gotten by stripping
  6.  ** the '.c'or '.cpp' or whatever off the current filename.
  7.  **
  8.  ** Accepts one command line argument, mode, which should be either 'wb'
  9.  ** or 'cli', and is used to determine what sort of environment the program
  10.  ** is debugged in.
  11.  **
  12.  ** Written by Kenneth Yarnall.  This code may be freely distributed
  13.  **/
  14.  
  15.  
  16. Options RESULTS
  17.  
  18. parse arg mode  /* Get the mode from the command line */
  19.  
  20. GetFilePath     /*  Gets the complete path+filename for the current doc */
  21. path = RESULT
  22.  
  23. dotpos = LastPos('.', path)
  24. if dotpos ~= 0 then do
  25.     ext = SubStr(path, dotpos+1)
  26.     if ext ~= 'c' & ext ~= 'cpp' & ext ~= 'cxx' then do
  27.         SetStatusBar "Must be editing a C file"
  28.         exit 10
  29.     end
  30. end
  31. else do
  32.     SetStatusBar "Must be editing a C file"
  33.     exit 10
  34. end
  35.  
  36. executable = Left(path, dotpos-1)
  37.  
  38. /* Pass the CPR commandline to the shell */
  39.  
  40. Address 'COMMAND'
  41. 'run cpr -' || mode || ' ' || executable
  42.